package gxb.test03;

import java.util.Scanner;

public class demo03 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.print("请输入总钱数（元）：");
        double totalMoney = scanner.nextDouble();

        int hundred = (int) totalMoney / 100;
        totalMoney %= 100;

        int fifty = (int) totalMoney / 50;
        totalMoney %= 50;

        int twenty = (int) totalMoney / 20;
        totalMoney %= 20;

        int ten = (int) totalMoney / 10;
        totalMoney %= 10;

        int five = (int) totalMoney / 5;
        totalMoney %= 5;

        int one = (int) totalMoney;

        int coins = (int) Math.round((totalMoney - one) * 100);
        int fiftyCents = coins / 50;
        coins %= 50;

        int tenCents = coins / 10;
        coins %= 10;

        int oneCent = coins;

        System.out.println(hundred + "张佰圆纸钞");
        System.out.println(fifty + "张伍拾圆纸钞");
        System.out.println(twenty + "张贰拾圆纸钞");
        System.out.println(ten + "张拾圆纸钞");
        System.out.println(five + "张伍圆纸钞");
        System.out.println(one + "个壹圆硬币");
        System.out.println(fiftyCents + "个伍角硬币");
        System.out.println(tenCents + "个壹角硬币");
        System.out.println(oneCent + "个壹分硬币");

        scanner.close();
    }
}
